﻿<%@ WebHandler Language="C#" Class="findName" %>

using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using SQLExecute;


public class findName : IHttpHandler {
    
    public void ProcessRequest (HttpContext context)     
    {
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");

        string prefixText = context.Request.QueryString["q"];
        string sql = "select fullname from tbl_profiles where fullname like N'" + prefixText + "%'";
        StringBuilder strHoTen = new StringBuilder();
        SqlDataReader r = SqlHelper.ExecuteReader(Common.strConnect, CommandType.Text, sql);
        while (r.Read())        
            strHoTen.Append(r["fullname"]).Append(Environment.NewLine);
        
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }
    
    

}